class MyPageHeader extends BaseEditMaster {
    constructor(dataId, currentTaskPrivileges, nextTaskPrivileges, pageStatus, pageListData,
            returnUrl, fetchDataUrl, saveUrl, exportUrl, printUrl) {
        super(dataId, currentTaskPrivileges, nextTaskPrivileges, pageStatus, pageListData,
                returnUrl, fetchDataUrl, saveUrl, exportUrl, printUrl);
    }
    // 得到主表数据
    GetEntityData() {
        let item = {};
        item['headerId'] = $("#HeaderId").val();
        item['reasonId'] = $.trim($("#ReasonId").val());
        item['billNo'] = $.trim($("#BillNo").val());
        item['rsHeaderId'] = $.trim($("#RsHeaderId").val());                             // 领料单标识
        item['dateOfStockOut'] = $.trim($("#DateOfStockOut").val());                     // 出库日期       
        item['requisitedBy'] = formatNullInputValue($.trim($("#RequisitedBy").val()));   // 领料员        
        item['description'] = formatNullInputValue($.trim($("#Description").val()));     // 备注
        item['createdBy'] = $.trim($("#UserId").val());
        item['updatedBy'] = $.trim($("#UserId").val());
        //return JSON.stringify(item);
        return item;
    }
    FillData(data) {
        let item = data.HeaderEntity;
        $("#HeaderId").val(item.headerId);
        $("#BillNo").val(item.billNo);
        $("#DateOfStockOut").val(item.dateOfStockOut);
        $("#RsHeaderId").val(formatNullData(item.rsHeaderId));
        $("#StyleNo").val(item.styleNo);
        $("#MaterialRequisitionUnitName").val(item.materialRequisitionUnitName);
        $("#RequisitedBy").val(item.requisitedBy);
        $("#RequisitedByName").val(item.requisitedByName);
        $("#Description").val(item.description);
        $("#UpdatedByName").val(item.updatedByName);
        $("#UpdatedDate").val(formatNullData(item.updatedDate));
        $("#ReasonId").val(formatNullData(item.reasonId));

        // 显示明细数据
        _InstancePageLines.BuildDataTable(data.LinesList);

        // 编辑状态时不允许更改领料单位和款号
        $("#ChoiceMaterialRequisitionUnit").attr("onclick", "");

        this.currentTaskPrivileges = item.currentTaskPrivileges;
        this.nextTaskPrivileges = item.nextTaskPrivileges;
        this.unCheckFlag = item.unCheckFlag;
        this.SetPageElementStatus(this.HidePageElement, this.ShowPageElement, function () {
            _InstancePageLines.AutoAdjustTableHeightForLines();
        });
        $("#BillNo").focus();
    }
    Save() {
        //step 1、进行页面验证，失败则返回
        if (!$("#form_data").valid())
            return;

        if (this.pageStatus === 1) {
            super.DoAjax(this.GetEntityData(), "/inventory/stock_out/header/insert.html", function (data, _this) {
                if (data.Key !== undefined) {
                    $("#HeaderId").val(data.Key);   // 设置刚才插入的记录ID
                    _this.dataId = data.Key;
                    $("#Action").val(2);
                    _this.pageStatus = 2;
                    _InstancePageLines.BuildDataTable(data.LinesList);
                    ShowSuccessMessagePanel("新增成功。");
                }
            });
        } else {
            super.DoAjax(this.GetEntityData(), "/inventory/stock_out/header/update.html", function (data, _this) {
                ShowSuccessMessagePanel("更新成功。");
            });
        }
    }
    New() {
        super.New();
        $("#HeaderId").val(0);
        $("#panelSlave").hide();
        // 新增状态时允许更改款号
        let _event_onclick = '_InstancePageHeader.DoChoiceMaterialRequisitionUnit()';
        $("#ChoiceMaterialRequisitionUnit").attr("onclick", _event_onclick);

        this.FetchNewBillNo();   // 设置新的单据号

        // 默认设置一些值         
        $("#DateOfStockOut").val(getCurrentDate());

        // 领料员默认为登录者
        $("#RequisitedBy").val($("#UserId").val());
        $("#RequisitedByName").val($("#UserName").val());
        $("#UpdatedDate").val(getCurrentDate());
        $("#UpdatedByName").val($("#UserName").val());
        $("#ChoiceMaterialRequisitionUnit").show();
        $("#ButSave").show();

        $('#tabData11 tbody').empty();
        $('#tabData12 tbody').empty();
        //_InstancePageLines.rows = 0;
        //自适应高度
        //_InstancePageLines.AutoAdjustTableHeightForLines();

        $("#BillNo").focus();
    }
    // 自动设置设置新的单据号
    FetchNewBillNo() {
        super.DoAjax({}, "/inventory/stock_out/header/fetchNewBillNo.html", function (data, _this) {
            $("#BillNo").val(data.BillNo);
        });
    }
    FetchLinesByHeaderKey(headerkey) {
        super.DoAjax(headerkey, "/inventory/stock_out/fetchLinesByHeaderKey.html", function (data, _this) {
            // 显示明细数据
            _InstancePageLines.BuildDataTable(data);
        });
    }
    // 选择领料单位、款号
    DoChoiceMaterialRequisitionUnit() {
        let _choice = new CommonChoice();
        _choice.DoChoiceRequisitionSlip(0, '选择领料单位', (data) => {
            if (data) {
                $("#RsHeaderId").val(parent.arrChoice[0][0]);
                $("#StyleNo").val(parent.arrChoice[0][1]);
                $("#MaterialRequisitionUnitName").val(parent.arrChoice[0][4]);
            }
        });
        $("#MaterialRequisitionUnitName").focus();
    }
    // 选择领料人
    DoChoiceRequisitedBy() {
        let _choice = new CommonChoice();
        _choice.DoChoiceUser(0, '选择领料员', '生产', (data) => {
            if (data) {
                $("#RequisitedBy").val(data[0]);
                $("#RequisitedByName").val(data[1]);
                $("#RequisitedByName").focus();
            }
        });
        $("#RequisitedByName").focus();
    }
    DoPrintPreview() {
        window.open(parent.basePath + this.printUrl + "?id=" + $("#HeaderId").val() + "&cklx=" + $("#ReasonId").find("option:selected").text());
    }
    ShowPageElement() {
        $("Button.act__save").show();
        if (!$("span.act__delete").hasClass("act__delete")) {
            $("span.act__delete").addClass("trash");
            $("span.act__delete i").addClass("fa-all fa-trash-o fa-1");
        }
    }
    HidePageElement() {
        $("Button.act__save").hide();
        $("span.act__delete").removeClass("trash");
        $("span.act__delete i").removeClass("fa-all fa-trash-o fa-1");
    }
    Expand() {
        super.Expand(function () {
            // 自适应高度
            _InstancePageLines.AutoAdjustTableHeightForLines();
        });
    }
    Collapse() {
        super.Collapse(function () {
            // 自适应高度
            _InstancePageLines.AutoAdjustTableHeightForLines();
        });
    }
}

class MyPageLines extends BaseEditSlave {
    constructor() {
        super('', '', '');
        this.$input = null;
    }
    ScrollTo() {
        $('#divH12').scrollLeft($('#divD12').scrollLeft());
        $('#divD11').scrollTop($('#divD12').scrollTop());
    }
    BuildDataTable(result) {
        $('#tabData11 tbody').empty();
        $('#tabData12 tbody').empty();
        // 得到数据列表
        if (result === null || result.length === 0) {
            this.rows = 0;
            // 自适应高度
            _InstancePageLines.AutoAdjustTableHeightForLines();
            $("#loading").hide();
            return false;
        }
        let content01 = '';
        let content02 = '';
        this.rows = result.length;
        this.numCheckbox = result.length;
        for (let i = 0; i < result.length; i++) {
            let id = result[i].linesId;
            content01 += '<tr _mash_id="' + id + '">';
            content01 += '<td><label style="margin-left:3px;" class="btn" for="R-' + id + '"><input id="R-' + id + '" name="_check_row" type="checkbox" onclick="_InstancePageLines.DoCheckRow($(this),\'_check_row\', $(\'#CheckAll\'));" value="' + id + '"/><i></i><span></span></label></td>';
            content01 += '<td class="column__action"><span title="删除" class="trash act__delete" onclick="_InstancePageLines.DeleteLines($(this));"><i class="fa-all fa-trash-o fa-1"></i></span></td>';
            content01 += '<td>' + formatNullData(result[i].supplierName) + '</td>';
            content01 += '<td>' + formatNullData(result[i].materialName) + '</td>';
            content01 += '<td class="edited-cell">' + formatNullData(result[i].partOfNeed) + '</td>';
            content01 += '<td class="edited-cell">' + formatNullData(result[i].materialCode) + '</td>';
            content01 += '</tr>';

            content02 += '<tr _mash_id="' + id + '">';
            content02 += '<td>' + formatNullData(result[i].productQuantity) + '</td>';
            content02 += '<td >' + formatNullData(result[i].floatingIncrement === 0 ? null : result[i].floatingIncrement) + '</td>';
            content02 += '<td>' + formatNullData(result[i].suitCuttingQuantity === 0 ? null : result[i].suitCuttingQuantity) + '</td>';
            content02 += '<td>' + formatNullData(result[i].productSizeName) + '</td>';
            content02 += '<td style="text-align:center;">' + formatNullData(result[i].uomName) + '</td>';
            content02 += '<td>' + formatNullData(result[i].productColourName) + '</td>';
            content02 += '<td>' + formatNullData(result[i].factoryPieceYardage === 0 ? null : result[i].factoryPieceYardage) + '</td>';
            content02 += '<td >' + formatNullData(result[i].seamPieceYardage === 0 ? null : result[i].seamPieceYardage) + '</td>';
            content02 += '<td>' + formatNullData(result[i].suitCutPieceYardage === 0 ? null : result[i].suitCutPieceYardage) + '</td>';
            content02 += '<td>' + formatNullData(result[i].fabricWidth) + '</td>';
            content02 += '<td>' + formatNullData(result[i].materialColourName) + '</td>';
            content02 += '<td>' + formatNullData(result[i].specification) + '</td>';          // 规格 
            content02 += '<td>' + formatNullData(result[i].quantityDemandPlan) + '</td>';     // 调达表中的必要数
            let _productQuantity = (result[i].productQuantity + result[i].floatingIncrement) * result[i].seamPieceYardage;
            content02 += '<td>' + formatNullData(_productQuantity === 0 ? null : _productQuantity.toFixed(2)) + '</td>';     // 生产必要数
            content02 += '<td>' + formatNullData(result[i].suitCuttingQuantity === 0 ? null : result[i].suitCuttingQuantity.toFixed(2)) + '</td>';        // 套裁数量
            content02 += '<td >' + formatNullData(result[i].stockLevels === 0 ? null : result[i].stockLevels) + '</td>';       // 库存数（调达表中）
            content02 += '<td>' + formatNullData(result[i].quantityDemand === 0 ? null : result[i].quantityDemand) + '</td>';  // 补给数（调达表中）
            //content02 += '<td>' + formatNullData(result[i].seamLoss === 0 ? null : result[i].seamLoss) + '</td>';              // 生产损耗数
            let _tmp = result[i].stockOutQuantity + result[i].readyStockOutQuantity - _productQuantity;
            _tmp = _tmp < 0 ? 0 : _tmp;
            content02 += '<td>' + _tmp.toFixed(3) + '</td>';              // 生产损耗数 = 出库数 + 已出库 - 生产补给数
            content02 += '<td>' + formatNullData(_productQuantity.toFixed(2) + result[i].seamLoss) + '</td>';                          // 生产补给数
            content02 += '<td>' + formatNullData(result[i].readyStockOutQuantity === 0 ? null : result[i].readyStockOutQuantity) + '</td>';             // 已出库数
            content02 += '<td class="edited-cell">' + formatNullData(result[i].stockOutQuantity === 0 ? null : result[i].stockOutQuantity) + '</td>';    // 本次出库
            content02 += '<td class="edited-cell">' + formatNullData(result[i].stockAdjustment === 0 ? null : result[i].stockAdjustment) + '</td>';          // 调配库存            
            content02 += '<td class="edited-cell">' + formatNullData(result[i].description) + '</td>';    //
            content02 += '</tr>';
            $('#tabData11 tbody').append(content01);
            $('#tabData12 tbody').append(content02);
            content01 = '';
            content02 = '';
        }
        let _cellid = "_cell__field";
        let _cellname = "__cell__field";
        $('#tabData12 tbody tr').find("td.edited-cell").click(function () {
            OnCellClickEvent($(this), _cellid, _cellname, 0);
        });

        setTwoTableRowColor("tabData11", "tabData12");
        $("#panelSlave").show();
        this.AutoAdjustTableHeightForLines();
        $(window).resize();               // 防止因为出现滚动条而造成画面显示问题
    }
    GetLinesData() {
        let jsonResult = [];
        //得到修改过数据
        $('#tabData12 tbody').find("tr").each(function () {
            let $tr2 = $(this);
            if ($tr2.find("td.dirty").length) {
                let item = {};
                item['headerId'] = $("#HeaderId").val();    // 返回明细使用
                item['linesId'] = $tr2.attr("_mash_id");
                //item['floatingIncrement'] = formatNullInputValue($.trim($tr2.find('td').eq(1).text())) === null ? 0 : $.trim($tr2.find('td').eq(1).text());    // 生产浮动增量
                //item['seamPieceYardage'] = formatNullInputValue($.trim($tr2.find('td').eq(7).text())) === null ? 0 : $.trim($tr2.find('td').eq(7).text());     // 生产单用量
                //item['seamLoss'] = formatNullInputValue($.trim($tr2.find('td').eq(17).text())) === null ? 0 : $.trim($tr2.find('td').eq(17).text());           // 生产损耗数
                //item['stockLevels'] = formatNullInputValue($.trim($tr2.find('td').eq(15).text())) === null ? 0 : $.trim($tr2.find('td').eq(15).text());        // 库存数
                item['stockOutQuantity'] = formatNullInputValue($.trim($tr2.find('td').eq(20).text())) === null ? 0 : $.trim($tr2.find('td').eq(20).text());   // 出库数
                item['stockAdjustment'] = formatNullInputValue($.trim($tr2.find('td').eq(21).text())) === null ? 0 : $.trim($tr2.find('td').eq(21).text());      // 调配库存数
                item['description'] = formatNullInputValue($.trim($tr2.find('td').last().text()));        // 备注
                item['updatedBy'] = $("#UserId").val();
                jsonResult.push(item);
            }
        });
        return JSON.stringify(jsonResult);
    }
    SaveLines() {
        //step 1、进行页面验证，失败则返回
        let success_01 = CheckGridInput();
        if (!success_01)
            return;

        super.SaveLines("/inventory/stock_out/lines/update.html", function (data, $self) {
            if (data.Success) {
                // 刷新合同明细
                $self.BuildDataTable(data.LinesList);
                ShowSuccessMessagePanel("保存成功。");
            }
        });
    }
    DeleteLines($self) {
        let params = {};
        params['HeaderId'] = $("#HeaderId").val();
        params['LinesId'] = $self.parent().parent().attr("_mash_id");

        super.DeleteLines(params, "/inventory/stock_out/lines/delete.html", function (data, $self) {
            // 刷新明细
            $self.BuildDataTable(data.LinesList);
            ShowSuccessMessagePanel("删除成功。");
        });
    }
    // 批量选择的数据
    GetCheckedLinesData() {
        let jsonResult1 = [];
        $('#tabData11 tbody').find("tr").each(function () {
            if ($(this).children("td").eq(0).children("label").eq(0).children("input[type='checkbox'][name='_check_row']").is(":checked") === true) {
                let item = {};
                item['headerId'] = $("#HeaderId").val();
                item['linesId'] = $(this).attr("_mash_id");
                item['deletedBy'] = $.trim($("#UserId").val());
                jsonResult1.push(item);
            }
        });
        return JSON.stringify(jsonResult1);
    }
    BatchDeleteLines() {
        if ($('#tabData11 tbody').find("tr.row__selected").length === 0) {
            ShowErrorMessagePanel("请选择批量删除的记录。");
            return false;
        }
        super.BatchDeleteLines('/inventory/stock_out/lines/batch_delete.html', function (data, $self) {
            // 刷新明细
            $self.BuildDataTable(data);
            ShowSuccessMessagePanel("删除成功。");
            $("#CheckAll").prop("checked", false);
        });
    }
    // 增加明细
    Supplement() {
        // 为了防止在增加材料时之前修改过的内容丢失，所以要首先保存一下
        if ($('#tabData11 tbody tr').find("td.dirty").length > 0 || $('#tabData12 tbody tr').find("td.dirty").length > 0) {
            showModal(370, 140, '系统信息', '', null, null, 1, "数据有更新，是否需要保存？", () => {
                this.OnSaveLines();
            }, () => {
                return false;
            });
        } else {
            this.OnSupplement();
        }
    }
    // 补充明细记录
    OnSupplement() {
        let criterion = {};
        criterion['HeaderId'] = parseInt($("#HeaderId").val());
        criterion['RsHeaderId'] = parseInt($("#RsHeaderId").val());
        criterion['UserId'] = parseInt($("#UserId").val());
        super.DoAjax(criterion, "/inventory/stock_out/lines/supplement.html", (data, $self) => {
            $self.BuildDataTable(data);
            ShowSuccessMessagePanel("补充完成。");
        });
    }
    // 设置行选择后的状态
    SetRowStatus($self) {
        super.AdjustRowStatus($self, function ($row, index) {
            $('#tabData12 tbody tr:eq(' + index + ')').addClass("row__selected");
            // 设置删除按钮失效
            $row.children('td').eq(1).children('span').eq(0).attr("onclick", "");
        }, function ($row, index) {
            $('#tabData12 tbody tr:eq(' + index + ')').removeClass("row__selected");
            // 设置删除按钮有效
            let _event_delete_onclick = '_InstancePageLines.DeleteLines($(this))';
            $row.children('td').eq(1).children('span').eq(0).attr("onclick", _event_delete_onclick);
        });
    }
    AutoAdjustTableHeightForLines() {
        let h = $(window).height();
        let _tabTop = $("#tabHeader11").offset().top + 27;  // 用于随着窗口变化，下面明细高度随之变化的一个节点
        //$(document.body).append('<div id="test" style="background:red;width:100%;position:absolute; top:' + _tabTop + 'px;display:block;height:5px;z-index:10000" />');
        let _rc = Math.floor((h - _tabTop - 20) / 25);
        let _dh = _rc * 25;
        let _rowH = this.rows * 25; // 计算行高
        _dh = (_rowH >= _dh) ? _dh : _rowH;

        $("#divD11").css({"max-height": _dh, height: _dh});
        $("#divD12").css({"max-height": _dh + 18, height: _dh + 18});
    }
}

var _InstancePageHeader = null;
var _InstancePageLines = null;

//-----------------------------------------------------------------------------
// 页面初始化
//-----------------------------------------------------------------------------
function onPageReady() {
    let _pageStatus = parseInt($("#Action").val());
    let _dataId = $("#HeaderId").val();

    let stock_out_list_result = $.cookie("stock_out_list_result") === undefined ? "" : $.cookie("stock_out_list_result");
    let _pageListData = [];
    if (stock_out_list_result !== "") {
        _pageListData = stock_out_list_result.split(',');
        $("#rec_total_rows").text(_pageListData.length);
        $("#rec_cur_row").text($.inArray(_dataId, _pageListData) + 1);

        if (_pageListData.length > 0) {
            let index = $.inArray(_dataId, _pageListData);
            if (index === 0) {
                $("#ButPrev").attr("disabled", "disabled");
            } else {
                $("#ButNext").removeAttr("disabled");
            }
            if (index === (_pageListData.length - 1)) {
                $("#ButNext").attr("disabled", "disabled");
            } else {
                $("#ButPrev").removeAttr("disabled");
            }
        }
    } else {
        $("#rec_total_rows").text("1");
        $("#rec_cur_row").text("1");
    }

    _InstancePageHeader = new MyPageHeader(_dataId, 0, 0, _pageStatus, _pageListData,
            "/inventory/stock_out/list.html",
            "/inventory/stock_out/header/fetchByKey.html",
            "/inventory/stock_out/header/save.html",
            "/inventory/stock_out/export.html",
            "/inventory/stock_out/print.html");

    _InstancePageLines = new MyPageLines();

    $("#tabPanelHeader").wxTabs({tabContent: "tabPanelContent"});
    $("#hPanelSplitter").click(function () {
        if ($(this).children("i").hasClass("fa-angle-double-up")) {
            _InstancePageHeader.Collapse();
        } else {
            _InstancePageHeader.Expand();
        }
    });

    window.laydate.render({
        elem: '#DateOfStockOut',
        theme: '#393D49',
        trigger: 'click',
        done: function (value, date, endDate) {
            $("#DateOfStockOut").focus();
        }
    });

    _InstancePageHeader.OnPageLoad();
}

// 画面大小或者位置移动
function onPageResize() {
    let w = $(window).width();

    let wLeftList = 713; // 调达表左边列表固定宽度
    $("#divH12").css({width: w - 16 - wLeftList});
    $("#divD12").css({left: -1, width: w - wLeftList - 15});
    // 自适应高度
    if (_InstancePageLines !== null)
        _InstancePageLines.AutoAdjustTableHeightForLines();
}

//-----------------------------------------------------------------------------
// 验证函数
//-----------------------------------------------------------------------------
$.validator.setDefaults({
    ignore: 'hidden, [reaonly=readonly]'
});
$.validator.addMethod("valueNotEquals", function (value, element, arg) {
    return arg !== value;
}, "Value must not equal arg.");

$(function () {
    $("#form_data").validate({
        // Step 1：设置验证规则和错误消息
        rules: {
            _BillNo: "required",
            _MaterialRequisitionUnitName: "required",
            _StyleNo: "required",
            _RequisitedByName: "required",
            _DateOfStockOut: {
                dateISO: true,
                required: true
            },
            _ReasonId: {
                valueNotEquals: "-1",
                required: true
            }
        },
        messages: {
            _BillNo: "请填写出库单号。",
            _MaterialRequisitionUnitName: "请填写领料单位。",
            _StyleNo: "请填写款号。",
            _RequisitedByName: "请填写领料员。",
            _DateOfStockOut: {
                dateISO: "请填写正确的出库日期。",
                required: "请填写出库日期。"
            },
            _ReasonId: {
                valueNotEquals: "请选择出库类型。",
                required: "请选择出库类型。"
            }
        },
        // Step 2：设置验证触发事件
        onclick: false,
        onfocusout: false,
        onfocusin: false,
        onkeyup: false,
        onkeydown: false,
        focusInvalid: false,
        // Step 3：设置错误信息提示
        showErrors: window.showErrors  //使用自定义的错误显示方法
    });
});
// 验证输入
function CheckGridInput() {
    $('#tabData12 tbody').find("tr").each(function (index) {
        let _n1 = $.trim($(this).find('td').eq(1).text()).length > 0 ? $.trim($(this).find('td').eq(1).text()) : 0; //
        let _n7 = $.trim($(this).find('td').eq(7).text()).length > 0 ? $.trim($(this).find('td').eq(7).text()) : 0; //
        let _n15 = $.trim($(this).find('td').eq(15).text()).length > 0 ? $.trim($(this).find('td').eq(15).text()) : 0; //
        let _n17 = $.trim($(this).find('td').eq(17).text()).length > 0 ? $.trim($(this).find('td').eq(17).text()) : 0; //
        let _n18 = $.trim($(this).find('td').eq(18).text()).length > 0 ? $.trim($(this).find('td').eq(18).text()) : 0; //
        let _n19 = $.trim($(this).find('td').eq(19).text()).length > 0 ? $.trim($(this).find('td').eq(19).text()) : 0; //

        if (_n1 !== 0) {
            if (!isNumber(_n1)) {
                GridCheckErrHandle($(this), 1, '请输入正确的数字。');
            } else {
                GridCheckSuccessHandle($(this), 1);
            }
        }
        if (_n7 !== 0) {
            if (!isNumber(_n7)) {
                GridCheckErrHandle($(this), 7, '请输入正确的数字。');
            } else {
                GridCheckSuccessHandle($(this), 7);
            }
        }
        if (_n15 !== 0) {
            if (!isNumber(_n15)) {
                GridCheckErrHandle($(this), 15, '请输入正确的数字。');
            } else {
                GridCheckSuccessHandle($(this), 15);
            }
        }
        if (_n17 !== 0) {
            if (!isNumber(_n17)) {
                GridCheckErrHandle($(this), 17, '请输入正确的数字。');
            } else {
                GridCheckSuccessHandle($(this), 17);
            }
        }
        if (_n18 !== 0) {
            if (!isNumber(_n18)) {
                GridCheckErrHandle($(this), 18, '请输入正确的数字。');
            } else {
                GridCheckSuccessHandle($(this), 18);
            }
        }
        if (_n19 !== 0) {
            if (!isNumber(_n19)) {
                GridCheckErrHandle($(this), 19, '请输入正确的数字。');
            } else {
                GridCheckSuccessHandle($(this), 19);
            }
        }

    });

    if ($('#tabData11 tbody').find('td.error').length > 0 || $('#tabData12 tbody').find('td.error').length > 0) {
        ShowErrorMessagePanel('对不起，填写的数据有错误。');
        return false;
    } else {
        return true;
    }
}
function GridCheckErrHandle($row, index, errMsg) {
    $row.find('td').eq(index).addClass("error");
    $row.find('td').eq(index).attr('title', errMsg);
}
function GridCheckSuccessHandle($row, index) {
    $row.find('td').eq(index).removeClass("error");
    $row.find('td').eq(index).attr('title', '');
}



